package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ProductSpecificationManagementMapper;
import com.ruoyi.system.domain.ProductSpecificationManagement;
import com.ruoyi.system.service.IProductSpecificationManagementService;

/**
 * 商品规格管理 Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-29
 */
@Service
public class ProductSpecificationManagementServiceImpl implements IProductSpecificationManagementService
{
    @Autowired
    private ProductSpecificationManagementMapper productSpecificationManagementMapper;

    /**
     * 通过id查询商品规格管理
     *
     * @param id 商品规格管理主键
     * @return 商品规格管理
     */
    @Override
    public ProductSpecificationManagement selectProductSpecificationManagementById(Long id)
    {
        return productSpecificationManagementMapper.selectProductSpecificationManagementById(id);
    }

    /**
     * 通过规格名称查询商品规格管理列表
     *
     * @param specificationName 规格名称
     * @return 商品规格管理
     */
    @Override
    public List<ProductSpecificationManagement> selectProductSpecificationManagementListByName(String specificationName)
    {
        return productSpecificationManagementMapper.selectProductSpecificationManagementListByName(specificationName);
    }

    /**
     * 新增商品规格管理
     *
     * @param productSpecificationManagement 商品规格管理
     * @return 结果
     */
    @Override
    public int insertProductSpecificationManagement(ProductSpecificationManagement productSpecificationManagement)
    {
        return productSpecificationManagementMapper.insertProductSpecificationManagement(productSpecificationManagement);
    }

    /**
     * 修改商品规格管理
     *
     * @param productSpecificationManagement 商品规格管理
     * @return 结果
     */
    @Override
    public int updateProductSpecificationManagement(ProductSpecificationManagement productSpecificationManagement)
    {
        return productSpecificationManagementMapper.updateProductSpecificationManagement(productSpecificationManagement);
    }

    /**
     * 通过id批量删除商品规格管理信息
     *
     * @param ids 需要删除的商品规格管理主键
     * @return 结果
     */
    @Override
    public int deleteProductSpecificationManagementByIds(Long[] ids)
    {
        return productSpecificationManagementMapper.deleteProductSpecificationManagementByIds(ids);
    }

    /**
     * 通过id删除商品规格管理信息
     *
     * @param id 商品规格管理主键
     * @return 结果
     */
    @Override
    public int deleteProductSpecificationManagementById(Long id)
    {
        return productSpecificationManagementMapper.deleteProductSpecificationManagementById(id);
    }
}
